import api from '@/api'
import { message } from 'antd'
import {Navigate} from 'react-router-dom'
export default function Auth({children}:any) {
  const isToken=localStorage.getItem('token')
  if(isToken){
    return (
        <div>{children}</div>
      )
  }else{
    message.warning('您还没有登录，请重新登录')
    return <Navigate to="/login"></Navigate>
  }
 
}
